package com.chenhao.generator.constant;

/**
 * 模板引擎 枚举
 *
 * @author:chenHao
 * @version:1.0
 * @since:1.0
 * @createTime:2019-10-02
 */
public enum TemplateEnum {
    MYBATIS_PLUS_MODEL(1, "template/mybatis-plus-module"),
    MONOMER_PROJECT(2, "template/monomer-project"),
    DAN_TI(3, "template/dan-ti"),
    QIAN_XUN(4, "template/qianxun-module");


    private Integer code;

    private String filePath;


    TemplateEnum(Integer code, String filePath) {
        this.code = code;
        this.filePath = filePath;
    }

    public Integer getCode() {
        return code;
    }

    public String getFilePath() {
        return filePath;
    }


    public static String getFilePath(Integer code) {
        if (code == null) {
            return null;
        }
        for (TemplateEnum value : TemplateEnum.values()) {
            if (value.getCode().equals(code)) {
                return value.getFilePath();
            }
        }
        return null;
    }
}
